package com.quan.site.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.quan.commons.annotation.OperationLog;
import com.quan.commons.core.MyBaseController;
import com.quan.commons.vo.R;
import com.quan.site.commons.vo.SiteJoinUsVo;
import com.quan.site.entity.SiteJoinUs;
import com.quan.site.service.SiteJoinUsService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 官网-加入我们
 *
 * @author yhaoquan
 * @email yhaoquan@163.com
 * @date 2023-08-19 09:02:14
 */
@Slf4j
@Api(tags = "官网-加入我们")
@RestController
@RequestMapping("/api/sitejoinus")
public class ApiJoinUsController extends MyBaseController {

    @Autowired
    private SiteJoinUsService service;

    /**
     * 多条件查询信息详情
     *
     * @param vo
     * @return
     */
    @OperationLog(module = "官网-加入我们", title = "查询详情")
    @GetMapping("/info")
    public R info(SiteJoinUsVo vo) {
        QueryWrapper<SiteJoinUs> queryWrapper = new QueryWrapper<SiteJoinUs>(vo);
        SiteJoinUs siteJoinUs = this.service.getOne(queryWrapper);
        return R.ok().data(siteJoinUs);
    }

    /**
     * 根据ID查询信息详情
     *
     * @param {id}
     * @return
     */
    @OperationLog(module = "官网-加入我们", title = "查询详情")
    @GetMapping("/info/{id}")
    public R info(@PathVariable("id") Long id) {
        SiteJoinUs siteJoinUs = this.service.getById(id);
        return R.ok().data(siteJoinUs);
    }

}
